{{> header}}

<div class="user main">
    <div class="userBox">
        <div class="face"><img src="/uploads/{{user.avatar}}" alt=""/></div>
        <div class="info">
            <p>用户名：{{user.name}}</p>
            {{#if isSelf}}<p>邮箱：{{user.email}}</p>{{/if}}
            {{#if isSelf}}<p>注册时间：{{user.regTimeStr}}</p>{{/if}}
            {{#if isSelf}} <p>Token:c61c57b0-2f06-4dda-b896-e646f7b1a029</p>{{/if}}
            <p>积分：{{user.score}}</p>
            {{#if isSelf}}<p>个人网站：{{user.web}}</p>{{/if}}
            {{#if isSelf}}<p>所在地点：{{user.address}}</p>{{/if}}
            {{#if isSelf}}<p>微博：{{user.weibo}}</p>{{/if}}
            {{#if isSelf}}<p>GitHub：{{user.github}}</p>{{/if}}
            <p>简介：{{user.intro}}</p>
        </div>
    </div>

    {{#if isSelf}}
    <div class="box">
        <div class="title">
        {{#if user.collections.length}}
            <a href="/user/{{user._id}}/collections">{{user.collections.length}}个收藏话题</a>
        {{else}}
            <span>0个收藏话题</span>
        {{/if}}
        </div>
    </div>
    {{/if}}

    <div class="box">
        <div class="title">
            {{#if topics.more}}<a href="/user/{{user._id}}/topics" class="more">More>></a>{{/if}}
            <b>最近创建的话题</b>
        </div>
        <ul>
            {{#each topics.posts}}
                <li>
                    <span>{{ago}}</span>
                    <a href="/article/{{id}}">{{title}}</a>
                </li>
            {{/each}}
        </ul>
    </div>


    <div class="box">
        <div class="title">
            {{#if replies.more}}<a href="/user/{{user._id}}/replies" class="more">More>></a>{{/if}}
            <b>最近参与的话题</b>
        </div>
        <ul>
            {{#each replies.posts}}
                <li>
                    <span>{{ago}}</span>
                    <a href="/article/{{id}}">{{title}}</a>
                </li>
            {{/each}}
        </ul>
    </div>


</div>

<div class="det">
    {{>loginedSide}}
    {{>friendshipSide}}
</div>
